import Vue from "vue";
import VueRouter from "vue-router";
import Login from "@/components/login.vue";
import Index from "@/components/index.vue";
import Course from "@/components/course.vue"

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "login",
  },
  {
    path: "/index",
    name: "index",
    component: Index,
    children:[
      {
        path: "course",
        name: "course",
        component: Course,
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: Login,
  }  
];

const router = new VueRouter({
  routes,
});

export default router;
